package project.service;

import project.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author d11yu
 */
public interface UserService {
    /**
     * 注册用户
     *
     * @param user
     */
    public User register( User user) throws SQLException;

    /**
     * 登录，返回登录的user bean对象，如果返回null，则说明执行失败。
     *
     * @param user
     * @return
     */
    public User login( User user) throws SQLException;

    /**
     * 检查用户名是否存在
     *
     * @param username
     * @return
     */
    public boolean exists( String username) throws SQLException;

    /**
     * 检查用户名是否存在
     *
     * @param user
     * @return
     * @throws SQLException
     */
    public boolean exists( User user) throws SQLException;
}
